package com.pomodorotechnique.Data;

import com.sun.xml.internal.bind.CycleRecoverable.Context;

import android.content.*;
import android.database.Cursor;

public abstract class IDataBaseGS<T,Key> {
	public abstract void insertModel(T model);
	public abstract T getModel(Key key);
	public abstract void update(String s);
	public abstract void update(ContentValues values,String where,String[] args);
	public abstract int delete(Key key);
	public abstract int delete(String tableName,String where,String[] args);
	public abstract int delete(String where,String[] args);
	public abstract Cursor rawQuery(String cmd, String[] selectionArgs);
	
	public onInsertFinishListener onInsertFinishListener;
	public onDeleteFinishListener onDeleteFinishListener;
	public onUpdateFinishListener onUpdateFinishListener;
	
	public void setOnInsertFinishListener(onInsertFinishListener listener){
		onInsertFinishListener = listener;
	}
	
	public void setOnDeleteFinishListener(onDeleteFinishListener linster){
		onDeleteFinishListener = linster;
	}
	
	public void setOnUpdateFinishListener(onUpdateFinishListener linster){
		onUpdateFinishListener = linster;
	}
	
	public interface onInsertFinishListener{
		void onInsertFinish(Object sender,int affectedRows);
	}
	
	public interface onUpdateFinishListener{
		void onUpdateFinish(Object sender,int affectedRows);
	}
	
	public interface onDeleteFinishListener{
		void onDeleteFinish(Object sendert,int affectedRows);
	}
}